﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using zhangmenren.IService;
using zhangmenren.Models;
using zhangmenren.Models.ViewModle;
using zhangmenren.Repository;

namespace zhangmenren.Service
{
    public class ChapterService : IChapterService
    {
        private ChapterRepository chapterRepository = new ChapterRepository();
        public Task<int> Add(ChapterEntity entity)
        {
            return Task.FromResult(chapterRepository.Add(entity));
        }

        public Task<int> Del(int id)
        {
            return Task.FromResult(chapterRepository.Del(id));
        }

        public Task<IEnumerable<TuiJianModel>> FindByWork(int workId)
        {
            return Task.FromResult(chapterRepository.FindByWorkId(workId));
        }

        public Task<IEnumerable<ChapterEntity>> Selelct(int workId)
        {
            return Task.FromResult(chapterRepository.Select(workId));
        }
    }
}
